﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <title>仿微博平台</title>
    <link rel="stylesheet" id="style-css" href="${request.contextPath}/statics/css/style.css" type="text/css"
          media="all">
    <link rel="stylesheet" id="lmlblog-css" href="${request.contextPath}/statics/css/lmlblog.css" type="text/css"
          media="all">
    <link rel="stylesheet" id="all-css" href="${request.contextPath}/statics/css/all.css" type="text/css" media="all">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/frame.css" type="text/css" media="all">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/extra.css" type="text/css" media="all">
    <script type="text/javascript" src="${request.contextPath}/statics/js/jquery.min.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/js/ueditor.all.min.js"></script>
    <script async="" charset="utf-8" src="${request.contextPath}/statics/layer/layer.js"></script>
    <style type="text/css">
        img.wp-smiley,
        img.emoji {
            display: inline !important;
            border: none !important;
            box-shadow: none !important;
            height: 1em !important;
            width: 1em !important;
            margin: 0 .07em !important;
            vertical-align: -0.1em !important;
            background: none !important;
            padding: 0 !important;
        }

        .lmlblog-member-left-bg-xg li {
            text-align: center;
            height: 30px;
            color: #333;
            font-size: 16px;
        }

        .lmlblog-member-left-bg-xg li a:hover {
            color: #FF8862;
            cursor: pointer;
        }

        .S_bg2, blockquote, .W_btn_b, .W_input, .SW_fun_bg {
            background-color: #261d3b;
        }

        .send_weibo {
            background-image: none;
        }

        .send_weibo_long {
            height: auto;
            overflow: visible;
        }

        .send_weibo {
            margin: 0 0 10px 0;
            box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
            border-radius: 2px;
            padding: 15px 10px 10px;
            height: 140px;
            /*overflow: hidden;*/
        }

        .send_weibo .title_area {
            position: relative;
            overflow: hidden;
            height: 21px;
        }

        .clearfix {
            display: block;
        }

        .S_spetxt, a.S_ficon:hover, a:hover .S_ficon, a.current .S_ficon {
            color: #fa7d3c;
        }

        .S_error {
            color: #f00;
        }

        .S_spetxt_bg {
            background-color: #fa7d3c;
        }

        .W_btn_prev:hover, .W_btn_next:hover {
            border-color: #fa7d3c;
        }

        .W_btn_prev:hover, .W_btn_next:hover, a.S_ficon:hover, a:hover .S_ficon, a.current .S_ficon, a.S_txt1:hover, a.current .S_txt1, a.S_txt2:hover, .SW_fun:hover .S_func1 {
            text-decoration: none;
            cursor: pointer;
        }

        .S_ficon_dis, a.S_ficon_dis:hover, a:hover .S_ficon_dis {
            cursor: default;
            opacity: 0.5;
            filter: alpha(opacity=50);
        }

        .WB_timeline .current em {
            color: #fff;
        }

        .send_weibo {
            background-image: none;
        }

        .WB_miniblog {
            padding-top: 50px;
        }

        .S_page .WB_miniblog {
            padding-top: 50px;
        }

        .S_page .WB_frame {
            background-color: transparent !important;
        }

        #js_skin_public_base {
            height: 42px;
        }

        body, .S_page {
            background-color: #b4daf0;
            /*background-image: url("images/body_repeat.png?id=1414052827385");*/
            background-repeat: repeat-x;
            background-position: center 0;
        }

        .send_weibo .ficon_swtxt {
            color: #1b7fb6;
        }

        body, legend, .W_input:focus, .S_txt1, .W_btn_b, .SW_fun .S_func1 {
            color: #333;
            text-decoration: none;
        }

        .S_txt1_bg {
            background-color: #333;
        }

        .S_txt1_br {
            border-color: #333;
        }

        .S_txt2, .W_input, .W_btn_b_disable, .W_btn_b_disable:hover {
            color: #808080;
            text-decoration: none;
        }

        .S_txt2_bg {
            background-color: #808080;
        }

        .S_txt2_br {
            border-color: #808080;
        }

        .S_ficon, .S_ficon_dis, a.S_ficon_dis:hover, a:hover .S_ficon_dis {
            color: #696e78;
        }

        .S_ficon_bg {
            background-color: #696e78;
        }

        .S_ficon_br {
            border-color: #696e78;
        }

        a, .S_link1, a.S_txt1:hover, a.current .S_txt1, a.S_txt2:hover, .SW_fun:hover .S_func1 {
            color: #eb7350;
        }

        .S_link1_bg {
            background-color: #eb7350;
        }

        .S_link1_br {
            border-color: #eb7350;
        }

        .S_bg1, .SW_fun_bg:hover, .SW_fun_bg_active {
            background-color: #f2f2f5;
        }

        .S_bg1_c {
            color: #f2f2f5;
        }

        .S_bg1_br {
            border-color: #f2f2f5;
        }

        .W_btn_cardlink, .W_btn_tag_cur, .W_btn_tag_cur:hover {
            background-color: #f2f2f5 !important;
        }

        .S_bg2, blockquote, .W_btn_b, .W_input, .SW_fun_bg {
            background-color: #fff;
        }

        .S_bg2_c {
            color: #fff;
        }

        .S_bg2_br {
            color: #fff;
            border-color: #fff;
        }

        .S_bg3 {
            background-color: #eaeaec;
        }

        .S_line1, .W_btn_prev, .W_btn_next, .W_btn_b {
            border-color: #d9d9d9;
        }

        .W_btn_b_disable, .W_btn_b_disable:hover, .W_btn_tag_cur, .W_btn_tag_cur:hover {
            border-color: #d9d9d9 !important;
        }

        .S_line1_c {
            color: #d9d9d9;
        }

        .W_btn_b_disable .S_ficon {
            color: #d9d9d9 !important;
        }

        .S_line2 {
            border-color: #f2f2f5;
        }

        .S_line2_c {
            color: #f2f2f5;
        }

        .S_line3, .W_input, .send_weibo .input, .W_btn_b:hover {
            border-color: #cccccc;
        }

        .W_input, .send_weibo .input {
            background-color: #fff;
        }

        .WB_left_nav .S_txt1, .WB_left_nav a.S_txt1:hover, .WB_left_nav .S_ficon, .WB_left_nav a:hover .S_ficon, .WB_left_nav a.S_ficon:hover {
            color: #fff;
        }

        .WB_left_nav .lev a:hover, .WB_left_nav .lev_curr, .WB_left_nav .lev_curr:hover, .WB_left_nav .levmore .more {
            background-color: #82b9dc;
            background-color: rgba(255, 255, 255, 0.2);
            *background-color: #82b9dc;
        }

        .WB_left_nav .lev_Box, .WB_left_nav fieldset {
            border-color: #82b9dc;
            border-color: rgba(255, 255, 255, 0.2);
            *border-color: #82b9dc;
        }

        .WB_frame {
            background-color: #93c5e3;
            background-color: rgba(70, 149, 194, 0.3);
            *background-color: #93c5e3;
        }

        .WB_timeline .S {
            color: #47a6d9;
            border-left-color: #47a6d9;
        }

        .WB_timeline .current em, .WB_timeline .S_dot, .W_gotop {
            background-color: #47a6d9;
        }

        .WB_miniblog {
            background: url("images/body_bg.jpg?id=201503261330") no-repeat top center;
        }

        .S_page .WB_miniblog {
            background: url("images/body_bg_page.jpg?id=201503261330") no-repeat top center;
        }

        #js_skin_skin048_skin {
            height: 42px;
        }

        .W_ficon {
            font-family: "wbficonregular" !important;
            display: inline-block;
            -webkit-font-smoothing: antialiased;
        }

        .layer_pic_list {
            width: 252px;
            overflow: hidden;
            padding: 10px 0 5px 0;
        }

        .drag_pic_list .add a {
            display: block;
            font-size: 40px;
            font-weight: bold;
            color: #ccc;
            margin-top: 25px;
        }
        .lmlblog-post-images-list {
            height: auto;
            overflow: hidden;
            margin: 10px 20px;
        }
        .lmlblog-post-images-list img {
            width: 95%;

            width: 200px;
            height: 180px;
        }
        .lmlblog-post-images-list a {
            overflow: hidden;
            position: relative;
            float: left;
            width: 31%;
            box-sizing: border-box;
            padding: 0 10px 20px;
        }
        .W_new_count {
            position: absolute;
            right: -12px;
            top: -3px;
            border: 1px solid #fff;
        }
        li#head_login:hover {
            opacity: 1;
        }
        .lmlblog-post-user-info-time {
            width: 100%;
        }
        .head_user_info .layui-tab ul li {
            min-width: 80px;
            font-size: 13px;
        }
        .head_user_info .layui-tab {
            width: 400px;
        }
        .head_user_info .layui-tab:before {
            right: 215px;
        }
    </style>
</head>
<body>
<!-- 菜单 -->
<div class="menu-bar">
    <div class="head_content">
        <h1 class="m-logo"><a href="http://fightjava.com/" target="_blank"></a></h1>
        <div id="nav" class="menu-menu-1-container">
            <ul id="menu-menu-1" class="menu">
                <li class="menu-item menu-item-type-custom"><a href="${request.contextPath}"><i class="fa fa-home"></i>
                    首页</a></li>
                <li class="menu-item"><a href="${request.contextPath}/web/blogs">我的微博</a></li>

                <li class="menu-item"><a href="${request.contextPath}/web/praises">我赞过的</a></li>
                <li class="menu-item"><a href="${request.contextPath}/web/collects">我的收藏</a></li>

                <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="${request.contextPath}/web/friends"><i class="fa fa-comments-o"></i> 好友圈</a></li>
            </ul>
        </div>
        <span class="head_user_info">
            <ul>
                <li class="search_box" style="margin-top: 14px;">
                    <input type="text" id="searchText" onkeydown="if(event.keyCode==13) searchBlog(1,2,$(this).val(),1)" placeholder="请输入搜索内容(找微博、找人)......" style="width: 190px;height: 20px;margin-left: -130px;"/>
                </li>
                <li id="head_search" onclick="searchBlog(1,2,$('#searchText').val(),1)"><i class="fa fa-search"></i></li>
                <!--<span class="not_login" style="display: none;">-->
                <span class="not_login" style="">
                    <li id="head_login" onclick="window.location.href='${request.contextPath}/login.html'">登录</li>
                    <span class="head_login_middle">or</span>
                    <li id="head_reg" onclick="window.location.href='${request.contextPath}/register.html'">注册</li>
                </span>
                <span class="is_login" style="display: none;">
                    <li id="head_login" style="width: 124px;background-color: transparent;color:black;font-size: 14px;">
                        <div class="gn_set_list" style="display: inline; background-color: white;  top: 12px;  right: 118px; position: absolute;">
                            <a href="javascript:void(0);" node-type="msg" class="msg">
                                <em class="W_ficon ficon_mail S_ficon" style="font-size: 22px;">I</em>
                                <em class="W_new_count" style="font-size: 10px;">0</em>
                            </a>
                            <div class="layui-tab layui-tab-brief" style="left: -107px;top: 34px;display: none;" lay-filter="docDemoTabBrief">
                                  <ul class="layui-tab-title">
                                    <li class="layui-this">转发</li>
                                    <li>评论</li>
                                    <li>回复</li>
                                    <li>点赞</li>
                                    <li>粉丝关注</li>
                                  </ul>
                                  <div class="layui-tab-content" style="height: 300px;">
                                      <div class="layui-tab-item forwardBlog layui-show"><div class="layui-card-header">无新消息</div></div>
                                      <div class="layui-tab-item comment"><div class="layui-card-header">无新消息</div></div>
                                      <div class="layui-tab-item reply"><div class="layui-card-header">无新消息</div></div>
                                      <div class="layui-tab-item praise"><div class="layui-card-header">无新消息</div></div>
                                      <div class="layui-tab-item concern"><div class="layui-card-header">无新消息</div></div>
                                  </div>
                            </div>
                            <div class="gn_topmenulist_tips" style="display:none" node-type="tips"></div>
                      </div>
                        <span onclick="window.location.href='${request.contextPath}/web/center'" id="name"></span>
                        <span onclick="window.location.href='${request.contextPath}/logout'">&nbsp;&nbsp;退出</span>
                    </li>
                </span>

            </ul>
    </div>
    <div style="clear: both;"></div>
</div>
</div>
<div style="clear: both;"></div>
<div class="lmlblog-member-main" data="1">
    <div class="lmlblog-member-bg" style="background-image: none;margin-top: -25px;">
        <div class="lmlblog-member-content">
            <div class="lmlblog-member-content-list clear">
                <div class="lmlblog-member-left" style="width: 133px;">
                    <div class="lmlblog-member-left-bg-xg clear" style="width:100px;">
                        <li><a href="${request.contextPath}">首页</a></li>
                        <li><a href="${request.contextPath}/web/blogs">我的微博</a></li>
                        <li><a href="${request.contextPath}/web/praises">我赞过的</a></li>
                        <li><a href="${request.contextPath}/web/collects">我的收藏</a></li>

                        <li><a href="${request.contextPath}/web/friends">好友圈</a></li>
                    </div>
                </div>
                <div class="lmlblog-member-right" style="width: 165px;float: right;">
                    <div class="lmlblog-member-left-follow clear">
                        <div align="center">
                            <img id="imgUrl" style="width: 80px;border-radius: 50px;" src="http://mind-warning.test.upcdn.net/headPortrait/head_20210813113641.jpg" class="avatar">
                        </div>
                        <div id="username" style="margin-top: 10px;text-align: center;">欢迎您，游客</div>
                        <div style="margin-top: 10px;">
                            <li style="width: 33%;" onclick="window.location.href='${request.contextPath}/web/blogs'">
                                <strong id="blogTotal">0</strong>
                                <span>微博</span>
                            </li>
                            <li style="width: 33%;">
                                <strong id="concernsTotal">0</strong>
                                <span>关注</span>
                            </li>
                            <li style="width: 33%;">
                                <strong id="fansTotal">0</strong>
                                <span>粉丝</span>
                            </li>
                        </div>
                    </div>
                </div>
                <div class="lmlblog-member-right" style="margin-right: 10px;">
                    <div class="lmlblog-post-list">
                        <div id="v6_pl_content_publishertop">
                            <div class="send_weibo S_bg2 clearfix send_weibo_long" node-type="wrap">
                                <div class="title_area clearfix">
                                    <div class="title" node-type="publishTitle"><span
                                            class="txt">What’s new with you?</span>
                                        <p class="W_swficon ficon_swtxt" style="font-size: 14px!important;">
                                            <em class="spac1" style="letter-spacing: 0px;">有什么新鲜事想告诉大家?</em>
                                        </p>
                                    </div>
                                </div>
                                <div class="input " node-type="textElDiv">
                                    <textarea class="W_input" title="微博输入框"    style="height: 68px; margin: 0px; padding: 0px; border-style: none; border-width: 0px; font-size: 14px; overflow-wrap: break-word; line-height: 18px; overflow: hidden; outline: none;"></textarea>
                                    <div class="send_succpic" style="display:none" node-type="successTip"><span
                                            class="W_icon icon_succB"></span><span class="txt send_weibo">发布成功</span>
                                    </div>
                                    <form style="display:none;" node-type="extradata">
                                        <input name="pollid" value="">
                                        <input name="pub_source" value="main_">
                                    </form>

                                </div>
                                <div class="func_area clearfix" node-type="widget" layout-shell="true">
                                    <div class="func">
                                        <a id="fbwb" href="javascript:void(0);" class="W_btn_a btn_30px">发布</a>
                                    </div>
                                    <div class="kind">
                                        <a class="S_txt1" href="javascript:void(0);" style="position: relative;"><em
                                                class="W_ficon ficon_image">p</em>图片
                                            <div style="position: absolute; left: 0px; top: 0px; display: block; overflow: hidden; background-color: rgb(0, 0, 0); opacity: 0; width: 49px; height: 24px;">
                                                <form node-type="form" action-type="form" id="pic_upload" name="pic_upload"
                                                      target="upload_target" enctype="multipart/form-data" method="POST"
                                                      style="overflow: hidden; opacity: 0; height: 24px; width: 49px;">
                                                    <input type="file" accept="image/jpg,image/jpeg,image/png,image/gif"
                                                           hidefoucs="true" node-type="fileBtn" name="pic1"
                                                           style="cursor:pointer;width:1000px;height:1000px;position:absolute;bottom:0;right:0;font-size:200px;"
                                                           multiple="multiple">
                                                </form>
                                            </div>
                                        </a>
                                    </div>
                                    <div class="W_layer W_layer_pop" style="left: 4px; top: 40px;display: none;">
                                        <div class="content">
                                            <div class="W_layer_close">
                                                <a href="javascript:void(0)" class="W_ficon ficon_close S_ficon">X</a>
                                            </div>
                                            <div node-type="inner">
                                                <div class="layer_pic_list clearfix" node-type="box">
                                                    <div class="W_layer_con_tit"><h1 class="W_f14 W_fb">本地上传</h1>
                                                        <h2 class="clearfix">
                                                            <span class="tit_txt W_fl">共<em class="num_totla">0</em>张，还能上传<em class="num_remain">9</em>张</span>
                                                        </h2>
                                                    </div>
                                                    <div class="drag_pic_list_box UI_scrollView" node-type="scrollView">
                                                        <div class="UI_scrollContainer">
                                                            <div class="UI_scrollContent" style="width: 284px;">
                                                                <ul class="drag_pic_list clearfix" special-node="weibo_pic_preList_ul">
                                                                    <li class="add" style="">
                                                                        <a href="javascript:;" title="">+</a>
                                                                        <div style="position: absolute; left: 0px; top: 0px; display: block; overflow: hidden; background-color: rgb(0, 0, 0); opacity: 0; width: 80px; height: 80px;">
                                                                            <form node-type="form" action-type="form"
                                                                                  id="pic_upload" name="pic_upload"
                                                                                  target="upload_target"
                                                                                  enctype="multipart/form-data"
                                                                                  method="POST"
                                                                                  style="overflow: hidden; opacity: 0; height: 80px; width: 80px;">
                                                                                <input type="file"
                                                                                       accept="image/jpg,image/jpeg,image/png,image/gif"
                                                                                       hidefoucs="true"
                                                                                       node-type="fileBtn" name="pic1"
                                                                                       style="cursor:pointer;width:1000px;height:1000px;position:absolute;bottom:0;right:0;font-size:200px;"
                                                                                       id="swf_upbtn_158281721801771"
                                                                                       multiple="multiple"></form>
                                                                        </div>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="UI_scrollBar W_scroll_y S_bg1"
                                                             style="visibility: hidden;">
                                                            <div class="bar S_txt2_bg" style="top: 0%; height: 100%;"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="W_layer_arrow">
                                                <span node-type="arrow" class="W_arrow_bor W_arrow_bor_t"  style="left: 10px;">
                                                    <i class="S_line3"></i>
                                                    <em  class="S_bg2_br"></em>
                                                </span>
                                                <div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="list">

                            <!--<div class="lmlblog-posts-list words" style="background-image:url(); " data="4197">
                                <div class="lmlblog-post-user-info">
                                    <div class="lmlblog-post-user-info-avatar" user-data="1">
                                        <a href="#" style="display: inline-block;">
                                            <span class="lmlblog-vip-icon"></span><img src="http://127.0.0.1:9900/miniBlog/image/20210111/user/1348527156908797952.png" class="avatar"></a>
                                        <div class="lmlblog-user-info-card">
                                            <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">
                                                <p>资料加载中...</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="lmlblog-post-user-info-name">
                                        <a href="#">
                                            <font style="color:#333;font-weight:600">十三爷</font>
                                        </a>
                                        <a href="javascript:void(0);" onclick="gz(this, 41)">
                                            <font style="color:#333;font-weight:0">关注</font>
                                        </a>
                                        <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>
                                    </div>
                                    <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">2021-01-11 15:14:47</div>
                                </div>
                                <div class="lmlblog-post-content ">人的一生中必须具有超常的自我管控能力，要避免自**扰和自我消耗；</div>
                                <div class="lmlblog-post-images-list clear">
                                    <a href="http://127.0.0.1:9900/miniBlog/image/20210111/blog/1348528712987193344.jpg" data-fancybox="gallery" class="fa lmlblog"><img src="http://127.0.0.1:9900/miniBlog/image/20210111/blog/1348528712987193344.jpg"></a>
                                    <a href="http://127.0.0.1:9900/miniBlog/image/20210111/blog/1348528727004557312.jpg" data-fancybox="gallery" class="fa lmlblog"><img src="http://127.0.0.1:9900/miniBlog/image/20210111/blog/1348528727004557312.jpg"></a>
                                </div>
                                <div class="lmlblog-post-bar" style="background-color: white;">
                                <li class="lmlblog-no-like" onclick="dz(this, 81)">
                                    <span>点赞</span>
                                </li>
                                <li onclick="sc(this, 81)">
                                    <span>收藏</span>
                                </li>
                                <li onclick="zf(this, 81)">
                                    <span>转发</span>
                                </li>
                                <li onclick="pl(this, 81, 0);">
                                    <i class="lmlblog-icon"></i>评论                                </li>
                                <li onclick="get_comment(this, 81, 0);">
                                    <i class="lmlblog-icon"></i>查看评论 <span>0</span>
                                </li>
                            </div>
                                <div class="lmlblog-post-footer-bar" style="background-color: white;margin-top: 0px;">
                                    <span title="2017-12-14 05:25:48"></span>
                                    <span></span></div><div id="pllb"></div>                        </div>-->

                        </div>

                        <div class="lmlblog-pager">
                            <a id="p" class="lmlblog-pager-right" href="javascript:void(0);"
                               style="width: 100%;text-align: center;" onclick="next_page()">下一页</a></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 底部 -->
<div style="clear:both"></div>
<div class="footer">
    <div class="footer_b_foot">
        <div class="footer_b_top">
        </div>
        <div class="footer_b_bottom" style="font-size: 20px;">
            <a href="http://www.mind-warning.top/" target="_blank" title="点击前往debug自建的技术社区，学习相应的技术干货">仿微博平台-前后端前程实战</a></div>
    </div>
</div>
<!-- 返回顶部 -->
<a href="javascript:returnTop();" class="cd-top" title="点击返回顶部"></a>

<script type="text/javascript">
    var sdelay = 0;

    //点击返回顶部
    function returnTop() {

        window.scrollTo(0, 0);
    }
</script>

<script type="text/javascript" src="${request.contextPath}/statics/js/base.js"></script>
<script type="text/javascript" src="${request.contextPath}/statics/js/all.js"></script>
<script type="text/javascript" src="${request.contextPath}/statics/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/statics/layui/layui.js"></script>
<script>
    var pageType=1;

    var page = 1;
    var pageIndex = 1;

    var is_login = false;
    var user_id = "";

    //上生产环境后需要调整为prod的
    var wsDomainUrl = "127.0.0.1:9900/miniBlog";

    jQuery(document).ready(function ($) {
        get_Userinfo();
        get_data(page, 2, "");



        $.fn.smartFloat = function () {
            var position = function (element) {
                var top = element.position().top, pos = element.css("position");
                $(window).scroll(function () {
                    var scrolls = $(this).scrollTop();
                    if (scrolls > top) {
                        if (window.XMLHttpRequest) {
                            element.css({
                                position: "fixed",
                                top: 50
                            });
                        } else {
                            element.css({
                                top: scrolls
                            });
                        }
                    } else {
                        element.css({
                            position: "absolute",
                            top: top
                        });
                    }
                });
            };
            return $(this).each(function () {
                position($(this));
            });
        };
        $(".lmlblog-member-left-bg-xg").smartFloat();

        //上传图片
        $("input[name='pic1']").change(function () {
            var num_totla = $(".pic").length;
            if(num_totla >=9 ){
                layer.msg("最多只能上传9张图片!");
                return;
            }
            var formData = new FormData();
            formData.append('img', $(this)[0].files[0]);
            $.ajax({
                "url": "${request.contextPath}/web/center/image/upload",
                type: "POST",
                data: formData,
                cache: false,
                contentType: false,
                processData: false,
                success: function (res) {
                    if (res.code == 0) {
                        $(".W_layer_pop").show();
                        $(".add").before('<li data-imgid="'+res.data.imgId+'" class="pic">\n' +
                            '<div style="background:url('+res.data.imgUrl+') center center;width:80px;height:80px;background-repeat: no-repeat;"></div>' +
                            '<span class="picbg"></span>\n' +
                            '<a  href="javascript:;" action-type="deleteImg" class="ico_delpic"></a>\n' +
                            '<i style="display:none;" class="W_icon icon_taged_pic"></i>\n' +
                            '</li>');
                        $(".num_totla").text(Number($(".num_totla").text()) + 1);
                        $(".num_remain").text(Number($(".num_remain").text()) - 1);
                    } else {
                        layer.msg(res.msg);
                    }
                },
                error: function (status) {

                }
            });
        });

        //发表微博
        $("#fbwb").click(function (res) {
            if (!is_login) {
                layer.msg("请先登录,再操作!");
                return;
            }
            var weibo = $(".W_input").val();
            if (weibo == "") {
                layer.msg("没有输入要发布的内容!");
                return;
            }
            var imgids = [];
            $(".pic").each(function(){
                imgids.push($(this).data("imgid"));
            });
            $.ajax({
                url: "${request.contextPath}/web/center/blog/send",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({content: weibo, imgIds:imgids.join(",")}),
                dataType: "json",
                success: function (result) {
                    if(result.code == 0){
                        layer.msg("发布成功!");
                        console.log(JSON.stringify(result));
                        setTimeout(function (res) {
                            window.location.href = "${request.contextPath}/";
                        },1000);
                    }else{
                        layer.msg(result.msg);
                    }
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        });

        //点击图片后进行预览
        $(".msg").click(function () {
            var msg_pop = $(".layui-tab-brief");
            if(msg_pop.is(':hidden')){
                msg_pop.show();
            }else{
                msg_pop.hide();
            }
        });

        $(document).on('click', '.ico_delpic',function () {
            $(this).parent().remove();
            $(".num_totla").text(Number($(".num_totla").text())-1);
            $(".num_remain").text(Number($(".num_remain").text())+1);
        });

        $(".ficon_close").click(function () {
            $(".W_layer_pop").hide();
        });


        //定时器-拉取消息
        setInterval(function () {
         get_msg();
        }, 8000);

    });


    //获取首页数据
    function get_data(pageNo, searchType, searchText) {
        pageType=1;

        $.get("${request.contextPath}/web/center/data", {
            pageNo: pageNo,
            searchType: searchType,
            searchText: searchText
        }, function (res) {
            var html = '';
            //动态获取后端接口返回的数据并做遍历解析
            for (var i = 0; i < res.data.blogList.list.length; i++) {
                html += '<div class="lmlblog-posts-list words" style="background-image:url(); " data="4197">\n' ;
                html +=    '                            <div class="lmlblog-post-user-info">\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' ;
                html +=   '                                    <a href="#" style="display: inline-block;">\n' ;
                html +=   '                                        <span class="lmlblog-vip-icon"></span><img src="' + res.data.blogList.list[i].headerImg + '" class="avatar"></a>\n' ;
                html +=   '                                    <div class="lmlblog-user-info-card">\n' ;
                html +=   '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' ;
                html +=   '                                            <p>资料加载中...</p>\n' ;
                html +=   '                                        </div>\n' ;
                html +=   '                                    </div>\n' ;
                html +=    '                                </div>\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-name">\n' ;
                html +=    '                                    <a href="#">\n' ;
                html +=   '                                        <font style="color:#333;font-weight:600">' + res.data.blogList.list[i].nickName + '</font>\n' ;
                html +=    '                                    </a>\n' ;
                html +=    '                                    <a href="javascript:void(0);" onclick="gz(this, ' + res.data.blogList.list[i].userId + ')">\n' ;
                html +=   '                                        <font style="color:#333;font-weight:0">'+(res.data.blogList.list[i].otherMap.hasConcern >= 1 ? '已关注' : '关注')+'</font>\n' ;
                html +=    '                                    </a>\n' ;
                html +=   '                                    <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>\n' ;
                html +=   '                                </div>\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">' + res.data.blogList.list[i].createTime + '</div>\n' ;
                html +=   '                            </div>' ;
                html +=   '                            <div class="lmlblog-post-content ">' + res.data.blogList.list[i].content + '</div>' ;
                if(res.data.blogList.list[i].imgUrls!=null && res.data.blogList.list[i].imgUrls.length>0){
                    html +=   '<div class="lmlblog-post-images-list clear">\n' ;
                    $.each(res.data.blogList.list[i].imgUrls,function (index,domEle){
                        html +=   '<a href="'+res.data.blogList.list[i].imgUrls[index]+'" data-fancybox="gallery"  class="fa lmlblog">' ;
                        html +=   '<img src="'+res.data.blogList.list[i].imgUrls[index]+'"></a>';
                    });
                    html +=   '</div>' ;
                }
                if(res.data.blogList.list[i].type == 2){
                    html += '<div class="lmlblog-posts-list words" style="background-color: aliceblue;margin: 0 10px 0 40px;background-image:url(); " data="4197">\n' ;
                    html +=    '                            <div class="lmlblog-post-user-info">\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' ;
                    html +=   '                                    <a href="#" style="display: inline-block;">\n' ;
                    html +=   '                                        <span class="lmlblog-vip-icon"></span><img src="'+ res.data.blogList.list[i].otherMap.fromBlog.headerImg + '" class="avatar"></a>\n' ;
                    html +=   '                                    <div class="lmlblog-user-info-card">\n' ;
                    html +=   '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' ;
                    html +=   '                                            <p>资料加载中...</p>\n' ;
                    html +=   '                                        </div>\n' ;
                    html +=   '                                    </div>\n' ;
                    html +=    '                                </div>\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-name">\n' ;
                    html +=    '                                    <a href="/#1">\n' ;
                    html +=   '                                        <font style="color:#333;font-weight:600">' + res.data.blogList.list[i].otherMap.fromBlog.nickName + '</font>\n' ;
                    html +=    '                                    </a>\n' ;
                    html +=   '                                    <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>\n' ;
                    html +=   '                                </div>\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">' + res.data.blogList.list[i].otherMap.fromBlog.createTime + '</div>\n' ;
                    html +=   '                            </div>' ;
                    html +=   '                            <div class="lmlblog-post-content ">' + res.data.blogList.list[i].otherMap.fromBlog.content + '</div>' ;
                    if(res.data.blogList.list[i].otherMap.fromBlog.imgUrls!=null && res.data.blogList.list[i].otherMap.fromBlog.imgUrls.length>0){
                        html +=   '<div class="lmlblog-post-images-list clear">\n' ;
                        $.each(res.data.blogList.list[i].otherMap.fromBlog.imgUrls,function (index,domEle){
                            html +=   '<a href="'+res.data.blogList.list[i].otherMap.fromBlog.imgUrls[index]+'" data-fancybox="gallery"  class="fa lmlblog">' ;
                            html +=   '<img src="'+res.data.blogList.list[i].otherMap.fromBlog.imgUrls[index]+'"></a>';
                        });
                        html +=   '</div>' ;
                    }
                    html +=   '                        </div>';
                }
                html +=    '                            <div class="lmlblog-post-bar" style="background-color: white;">\n' ;
                html +=   '                                <li class="lmlblog-no-like" onclick="dz(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasPraise >= 1 ? '已点赞' : '点赞') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="sc(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasCollect >= 1 ? '已收藏' : '收藏') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="zf(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasForward >= 1 ? '已转发' : '转发') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="pl(this, ' + res.data.blogList.list[i].id + ', ' + res.data.blogList.list[i].otherMap.commentTotal + ');">\n' ;
                html +=   '                                    <i class="lmlblog-icon"></i>评论' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="get_comment(this, ' + res.data.blogList.list[i].id + ', ' + res.data.blogList.list[i].otherMap.commentTotal + ');">\n' ;
                html +=   '                                    <i class="lmlblog-icon"></i>查看评论 <span>' + res.data.blogList.list[i].otherMap.commentTotal + '</span>\n' ;
                html +=   '                                </li>\n' ;
                if(user_id != "" && user_id == res.data.blogList.list[i].userId){
                    html +=   '                                <li onclick="del(this, ' + res.data.blogList.list[i].id + ');">\n' ;
                    html +=   '                                    <i class="lmlblog-icon"></i>删除 <span></span>\n' ;
                    html +=   '                                </li>\n' ;
                }
                html +=   '                            </div>\n' ;
                html +=   '                            <div class="lmlblog-post-footer-bar" style="background-color: white;margin-top: 0px;">\n' ;
                html +=    '                                <span title="2017-12-14 05:25:48"></span>\n' ;
                html +=   '                                <span></span></div><div id="pllb"></div>' ;
                html +=   '                        </div>';
            }
            $("#list").append(html);
            if (res.data.blogList.list.length > 0 && res.data.blogList.totalPage > page) {
                page++;
            } else {
                $(".lmlblog-pager").hide();
            }
        })
    }


    //获取当前用户信息
    function get_Userinfo() {
        $.get("${request.contextPath}/web/center/info/my", function (res) {
            console.log(res);
            if (res.code == 0) {
                $(".is_login").show();
                $(".not_login").hide();
                $("#username").text(res.data.userInfo.name);
                $("#name").text(res.data.userInfo.name);
                $("#imgUrl").attr("src", res.data.userInfo.imgUrl);

                $("#concernsTotal").text(res.data.concernsTotal);
                $("#fansTotal").text(res.data.fansTotal);
                $("#blogTotal").text(res.data.blogTotal);

                //登录成功后设置登录状态值以及相关数据
                is_login = true;
                user_id = res.data.userInfo.userId;



                //消息中心：方式一~由浏览器主动Ajax定时轮询获取
                get_msg();

                //消息中心：方式二~由浏览器主动建立与服务端的http连接(前提：需要登录成功重新刷新进入主页，保证这里的代码可以被执行) +
                //         登录成功但却没有实时的消息时，也需要首次获取
                //get_msg();

                //架构2.0
                //openSocket();
            } else {
                $(".is_login").hide();
                $(".not_login").show();
            }
        })
    }

    //关注和取消关注
    function gz(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        if ($(_this).text().replace(/[ ]/g, "").replace(/[\r\n]/g, "") == "关注") {
            $.ajax({
                url: "${request.contextPath}/web/center/concern/on",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({beConcernUserId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("关注成功!");
                    $(_this).find("font").text("已关注");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        } else {
            $.ajax({
                url: "${request.contextPath}/web/center/concern/cancel",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({beConcernUserId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("取消关注成功!");
                    $(_this).find("font").text("关注");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        }
    }

    //拉取用户消息
    function get_msg() {
        if(!is_login)
            return;

        $.get("${request.contextPath}/web/user/msg", function (res) {
            commonManageUserMsg(res);
        })
    }

    function commonManageUserMsg(res) {
        //console.log("通用的处理消息逻辑："+res);
        if (res.code == 0 && res.data!=null) {
            console.log(res);
            var html = "";
            for (var i = 0; i<res.data.forwardBlog.length; i++){
                if(res.data.forwardBlog[i].isRead==1){
                    html += "<div data-id=\""+res.data.forwardBlog[i].id+"\" class=\"layui-card-header\">"+res.data.forwardBlog[i].content+"</div>";
                }else{
                    html += "<div data-id=\""+res.data.forwardBlog[i].id+"\" class=\"layui-card-header\">"+res.data.forwardBlog[i].content+
                        "&nbsp;<a href='javascript:void(0);' onclick='clickHasRead(this, \""+res.data.forwardBlog[i].id+"\" )'>点击已读</a></div>";
                }
            }
            if(res.data.forwardBlog.length == 0){
                $(".forwardBlog").empty().append( "<div  class=\"layui-card-header\">暂无新转发</div>");
            }else{
                $(".forwardBlog").empty().append(html);
            }

            html = "";
            for (var i = 0; i<res.data.comment.length; i++){
                if(res.data.comment[i].isRead==1){
                    html += "<div data-id=\""+res.data.comment[i].id+"\" class=\"layui-card-header\">"+res.data.comment[i].content+"</div>";
                }else{
                    html += "<div data-id=\""+res.data.comment[i].id+"\" class=\"layui-card-header\">"+res.data.comment[i].content+
                        "&nbsp;<a href='javascript:void(0);' onclick='clickHasRead(this, \""+res.data.comment[i].id+"\" )'>点击已读</a></div>";
                }
            }

            if(res.data.comment.length == 0){
                $(".comment").empty().append( "<div  class=\"layui-card-header\">暂无新评论</div>");
            }else{
                $(".comment").empty().append(html);
            }

            html = "";
            for (var i = 0; i<res.data.reply.length; i++){
                if(res.data.reply[i].isRead==1){
                    html += "<div data-id=\""+res.data.reply[i].id+"\" class=\"layui-card-header\">"+res.data.reply[i].content+"</div>";
                }else{
                    html += "<div data-id=\""+res.data.reply[i].id+"\" class=\"layui-card-header\">"+res.data.reply[i].content+
                        "&nbsp;<a href='javascript:void(0);' onclick='clickHasRead(this, \""+res.data.reply[i].id+"\" )'>点击已读</a></div>";
                }
            }

            if(res.data.reply.length == 0){
                $(".reply").empty().append( "<div  class=\"layui-card-header\">暂无新回复</div>");
            }else{
                $(".reply").empty().append(html);
            }


            html = "";
            for (var i = 0; i<res.data.praise.length; i++){
                if(res.data.praise[i].isRead==1){
                    html += "<div data-id=\""+res.data.praise[i].id+"\" class=\"layui-card-header\">"+res.data.praise[i].content+"</div>";
                }else{
                    html += "<div data-id=\""+res.data.praise[i].id+"\" class=\"layui-card-header\">"+res.data.praise[i].content+
                        "&nbsp;<a href='javascript:void(0);' onclick='clickHasRead(this, \""+res.data.praise[i].id+"\" )'>点击已读</a></div>";
                }
            }

            if(res.data.praise.length == 0){
                $(".praise").empty().append( "<div  class=\"layui-card-header\">暂无新点赞</div>");
            }else{
                $(".praise").empty().append(html);
            }

            html = "";
            for (var i = 0; i<res.data.concern.length; i++){
                if(res.data.concern[i].isRead==1){
                    html += "<div data-id=\""+res.data.concern[i].id+"\" class=\"layui-card-header\">"+res.data.concern[i].content+"</div>";
                }else{
                    html += "<div data-id=\""+res.data.concern[i].id+"\" class=\"layui-card-header\">"+res.data.concern[i].content+
                        "&nbsp;<a href='javascript:void(0);' onclick='clickHasRead(this, \""+res.data.concern[i].id+"\" )'>点击已读</a></div>";
                }
            }

            if(res.data.concern.length == 0){
                $(".concern").empty().append( "<div  class=\"layui-card-header\">暂无新粉丝关注</div>");
            }else{
                $(".concern").empty().append(html);
            }

            $(".W_new_count").text(res.data['forwardBlog-unRead'] +res.data['comment-unRead'] + res.data['reply-unRead']+ res.data['praise-unRead'] + res.data['concern-unRead']);
        }
    }


    //点赞-取消点赞
    function dz(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        if ($(_this).text().replace(/[ ]/g, "").replace(/[\r\n]/g, "") == "点赞") {
            $.ajax({
                url: "${request.contextPath}/web/center/praise/on",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("点赞成功!");
                    $(_this).find("span").text("已点赞");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        } else {
            $.ajax({
                url: "${request.contextPath}/web/center/praise/cancel",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("取消点赞成功!");
                    $(_this).find("span").text("点赞");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        }
    }

    //收藏和取消收藏
    function sc(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        if ($(_this).text().replace(/[ ]/g, "").replace(/[\r\n]/g, "") == "收藏") {
            $.ajax({
                url: "${request.contextPath}/web/center/collect/on",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("收藏成功!");
                    $(_this).find("span").text("已收藏");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        } else {
            $.ajax({
                url: "${request.contextPath}/web/center/collect/cancel",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("取消收藏成功!");
                    $(_this).find("span").text("收藏");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        }

    }

    //评论
    function pl(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        console.log("评论:" + id);
        layer.prompt({title: '评论微博',},function(val, index){
            $.ajax({
                url: "${request.contextPath}/web/center/comment/on",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: id, content: val}),
                dataType: "json",
                success: function (result) {
                    layer.msg(result.msg);
                    if(result.code == 0){
                        setTimeout(function () {
                            window.location.reload();
                            layer.close(index);
                        },1000);
                    }

                },
                error: function (msg) {
                    layer.msg(msg);
                    console.log(msg);
                }
            });
        });
    }

    //删除微博
    function del(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        console.log("评论:" + id);
        layer.confirm('确定要删除吗?', {icon: 3, title:'删除'}, function(index){
            $.ajax({
                url: "${request.contextPath}/web/center/blog/delete",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({id: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg(result.msg);
                    setTimeout(function () {
                        window.location.reload();
                        layer.close(index);
                    },1000);
                },
                error: function (msg) {
                    layer.msg(msg);
                    console.log(msg);
                }
            });
        });
    }

    //回复
    function hf(blogId, commentId) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        console.log("评论:" + commentId);
        layer.prompt({title: '回复'},function(val, index){
            $.ajax({
                url: "${request.contextPath}/web/center/reply/on",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({blogId: blogId, commentId: commentId, content: val}),
                dataType: "json",
                success: function (result) {
                    layer.msg(result.msg);
                    setTimeout(function () {
                        window.location.reload();
                        layer.close(index);
                    },1000);
                },
                error: function (msg) {
                    layer.msg(msg);
                    console.log(msg);
                }
            });
        });
    }

    //获取评论列表信息
    function get_comment(_this, id, num) {
        if ($(_this).parent().parent().find("#pllb").text() != "") {
            $(_this).parent().parent().find("#pllb").empty();
            return;
        }
        $.get("${request.contextPath}/web/center/comments/blog", {blogId: id}, function (res) {
            console.log(res);
            var html = '';
            for (var i = 0; i < res.data.length; i++) {
                html += '<div class="lmlblog-posts-list words" style="background-image:url(); padding: 0;height: 35px;" data="4197">\n' +
                    '                            <div class="lmlblog-post-user-info" style="margin: 0 0 5px 20px;width: 610px;">\n' +
                    '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' +
                    '                                    <a href="#" style="display: inline-block;">\n' +
                    '                                        <span class="lmlblog-vip-icon"></span><img style="width:30px;height: 30px;" src="' + res.data[i].headerImg + '" class="avatar"></a>\n' +
                    '                                    <div class="lmlblog-user-info-card">\n' +
                    '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' +
                    '                                            <p>资料加载中...</p>\n' +
                    '                                        </div>\n' +
                    '                                    </div>\n' +
                    '                                </div>\n' +
                    '                                <div class="lmlblog-post-user-info-name">\n' +
                    '                                    <a href="/#1">\n' +
                    '                                        <font style="color:#795f98;">' + res.data[i].nickName + '</font>：<span>' + res.data[i].content + '</span>' +
                    '                                    </a>\n' +
                    '                                </div>\n' +
                    '                                <div class="lmlblog-post-user-info-time">' + res.data[i].commentTime + '<span class="lmlblog-mark lmlblog-lv" style="float: right;" onclick="hf('+ id +', '+res.data[i].id+')">回复</span></div>\n' +
                    '                            </div>' +
                    '                        </div>';
                for (var j = 0; j < res.data[i].replys.length; j++) {
                    html += '<div class="lmlblog-posts-list words" style="background-image:url(); padding: 0 0 0 30px;height: 35px;" data="4197">\n' +
                        '                            <div class="lmlblog-post-user-info" style="margin: 0 0 5px 20px;">\n' +
                        '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' +
                        '                                    <a href="#" style="display: inline-block;">\n' +
                        '                                        <span class="lmlblog-vip-icon"></span><img style="width:30px;height: 30px;" src="'+res.data[i].replys[j].headerImg+'" class="avatar"></a>\n' +
                        '                                    <div class="lmlblog-user-info-card">\n' +
                        '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' +
                        '                                            <p>资料加载中...</p>\n' +
                        '                                        </div>\n' +
                        '                                    </div>\n' +
                        '                                </div>\n' +
                        '                                <div class="lmlblog-post-user-info-name">\n' +
                        '                                    <a href="/#1">\n' +
                        '                                        <font style="color:#795f98;">' + res.data[i].replys[j].replyFrom + '<span style="color:#918ea5;">：回复</span>@' + res.data[i].nickName + '</font>：<span>' + res.data[i].replys[j].content + '</span>' +
                        '                                    </a>\n' +
                        '                                    <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>\n' +
                        '                                </div>\n' +
                        '                                <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">' + res.data[i].replys[j].replyTime + '</div>\n' +
                        '                            </div>' +
                        '                        </div>';
                }
            }
            $(_this).parent().parent().find("#pllb").empty().append(html);
        });
    }




    //转发微博
    function zf(_this, id) {
        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        if ($(_this).text().replace(/[ ]/g, "").replace(/[\r\n]/g, "") == "转发") {
            console.log("被转发的博客id:" + id);

            layer.prompt({title: '转发微博',formType: 2,area: ['300px', '150px'],},function(val, index){
                $.ajax({
                    url: "${request.contextPath}/web/center/blog/forward",
                    type: "POST",
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify({blogId: id, content: val}),
                    dataType: "json",
                    success: function (result) {
                        layer.msg(result.msg);
                        if(result.code == 0){
                            setTimeout(function () {
                                window.location.reload();
                                layer.close(index);
                            },3000);
                        }
                    },
                    error: function (msg) {
                        layer.msg(msg);
                        console.log(msg);
                    }
                });
                layer.close(index);
            });
        }else{
            layer.msg("您已经转发过该微博了!");
            return;
        }
    }

    //读消息
    function clickHasRead(_this,id) {
        console.log("点击已读:" + id);

        if (!is_login) {
            layer.msg("请先登录,再操作!");
            return;
        }
        if ($(_this).text().replace(/[ ]/g, "").replace(/[\r\n]/g, "") == "点击已读") {
            $.ajax({
                url: "${request.contextPath}/web/user/msg/read",
                type: "POST",
                contentType: "application/json;charset=utf-8",
                data: JSON.stringify({id: id}),
                dataType: "json",
                success: function (result) {
                    layer.msg("成功!");
                    $(_this).text("");
                    console.log(JSON.stringify(result));
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        }
    }


    //分页
    /*function next_page() {
        get_data(page, 2, "");
    }*/
    function next_page() {
        //alert(pageType);

        if(pageType == 1){
            get_data(page, 2, "");
        }else{
            searchBlog(pageIndex, 2, $("#searchText").val(),2);
        }
    }




    //搜索微博 - 最后一个参数叫 “搜索来源”：1=直接搜索；2=分页搜索
    function searchBlog(pageNo, searchType, searchText, sourceType) {
        if(sourceType==1){
            pageIndex=1;

            $("#list").html("");
        }

        pageType=2;
        //alert(pageNo+" - "+searchType+" - "+searchText);
        //var searchText=$("#searchText").val();

        //$("#list").html("");

        //方式一:传统的搜索
        //$.get("${request.contextPath}/web/center/data", {

        //方式二：全文检索-lucene
        $.get("${request.contextPath}/web/center/data/search", {
            //pageNo: page,
            pageNo:pageNo,

            searchType: searchType,
            searchText: searchText
        }, function (res) {
            var html = '';
            for (var i = 0; i < res.data.blogList.list.length; i++) {
                html += '<div class="lmlblog-posts-list words" style="background-image:url(); " data="4197">\n' ;
                html +=    '                            <div class="lmlblog-post-user-info">\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' ;
                html +=   '                                    <a href="#" style="display: inline-block;">\n' ;
                html +=   '                                        <span class="lmlblog-vip-icon"></span><img src="' + res.data.blogList.list[i].headerImg + '" class="avatar"></a>\n' ;
                html +=   '                                    <div class="lmlblog-user-info-card">\n' ;
                html +=   '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' ;
                html +=   '                                            <p>资料加载中...</p>\n' ;
                html +=   '                                        </div>\n' ;
                html +=   '                                    </div>\n' ;
                html +=    '                                </div>\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-name">\n' ;
                html +=    '                                    <a href="#">\n' ;
                html +=   '                                        <font style="color:#333;font-weight:600">' + res.data.blogList.list[i].nickName + '</font>\n' ;
                html +=    '                                    </a>\n' ;
                html +=    '                                    <a href="javascript:void(0);" onclick="gz(this, ' + res.data.blogList.list[i].userId + ')">\n' ;
                html +=   '                                        <font style="color:#333;font-weight:0">'+(res.data.blogList.list[i].otherMap.hasConcern >= 1 ? '已关注' : '关注')+'</font>\n' ;
                html +=    '                                    </a>\n' ;
                html +=   '                                    <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>\n' ;
                html +=   '                                </div>\n' ;
                html +=   '                                <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">' + res.data.blogList.list[i].createTime + '</div>\n' ;
                html +=   '                            </div>' ;
                html +=   '                            <div class="lmlblog-post-content ">' + res.data.blogList.list[i].content + '</div>' ;
                if(res.data.blogList.list[i].imgUrls!=null && res.data.blogList.list[i].imgUrls.length>0){
                    html +=   '<div class="lmlblog-post-images-list clear">\n' ;
                    $.each(res.data.blogList.list[i].imgUrls,function (index,domEle){
                        html +=   '<a href="'+res.data.blogList.list[i].imgUrls[index]+'" data-fancybox="gallery"  class="fa lmlblog">' ;
                        html +=   '<img src="'+res.data.blogList.list[i].imgUrls[index]+'"></a>';
                    });
                    html +=   '</div>' ;
                }
                if(res.data.blogList.list[i].type == 2){
                    html += '<div class="lmlblog-posts-list words" style="background-color: aliceblue;margin: 0 10px 0 40px;background-image:url(); " data="4197">\n' ;
                    html +=    '                            <div class="lmlblog-post-user-info">\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-avatar" user-data="1">\n' ;
                    html +=   '                                    <a href="#" style="display: inline-block;">\n' ;
                    html +=   '                                        <span class="lmlblog-vip-icon"></span><img src="'+ res.data.blogList.list[i].otherMap.fromBlog.headerImg + '" class="avatar"></a>\n' ;
                    html +=   '                                    <div class="lmlblog-user-info-card">\n' ;
                    html +=   '                                        <div class="info_card_loading"><img src="/miniBlog/statics/images/chat-loading.gif">\n' ;
                    html +=   '                                            <p>资料加载中...</p>\n' ;
                    html +=   '                                        </div>\n' ;
                    html +=   '                                    </div>\n' ;
                    html +=    '                                </div>\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-name">\n' ;
                    html +=    '                                    <a href="/#1">\n' ;
                    html +=   '                                        <font style="color:#333;font-weight:600">' + res.data.blogList.list[i].otherMap.fromBlog.nickName + '</font>\n' ;
                    html +=    '                                    </a>\n' ;
                    html +=   '                                    <span class="lmlblog-mark lmlblog-lv" title="经验：3815"></span><span class="lmlblog-mark lmlblog-vip"></span>\n' ;
                    html +=   '                                </div>\n' ;
                    html +=   '                                <div class="lmlblog-post-user-info-time" title="2017-12-14 05:25">' + res.data.blogList.list[i].otherMap.fromBlog.createTime + '</div>\n' ;
                    html +=   '                            </div>' ;
                    html +=   '                            <div class="lmlblog-post-content ">' + res.data.blogList.list[i].otherMap.fromBlog.content + '</div>' ;
                    if(res.data.blogList.list[i].otherMap.fromBlog.imgUrls!=null && res.data.blogList.list[i].otherMap.fromBlog.imgUrls.length>0){
                        html +=   '<div class="lmlblog-post-images-list clear">\n' ;
                        $.each(res.data.blogList.list[i].otherMap.fromBlog.imgUrls,function (index,domEle){
                            html +=   '<a href="'+res.data.blogList.list[i].otherMap.fromBlog.imgUrls[index]+'" data-fancybox="gallery"  class="fa lmlblog">' ;
                            html +=   '<img src="'+res.data.blogList.list[i].otherMap.fromBlog.imgUrls[index]+'"></a>';
                        });
                        html +=   '</div>' ;
                    }
                    html +=   '                        </div>';
                }
                html +=    '                            <div class="lmlblog-post-bar" style="background-color: white;">\n' ;
                html +=   '                                <li class="lmlblog-no-like" onclick="dz(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasPraise == 1 ? '已点赞' : '点赞') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="sc(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasCollect == 1 ? '已收藏' : '收藏') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="zf(this, ' + res.data.blogList.list[i].id + ')">\n' ;
                html +=   '                                    <span>' + (res.data.blogList.list[i].otherMap.hasCollect == 1 ? '已转发' : '转发') + '</span>\n' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="pl(this, ' + res.data.blogList.list[i].id + ', ' + res.data.blogList.list[i].otherMap.commentTotal + ');">\n' ;
                html +=   '                                    <i class="lmlblog-icon"></i>评论' ;
                html +=   '                                </li>\n' ;
                html +=   '                                <li onclick="get_comment(this, ' + res.data.blogList.list[i].id + ', ' + res.data.blogList.list[i].otherMap.commentTotal + ');">\n' ;
                html +=   '                                    <i class="lmlblog-icon"></i>查看评论 <span>' + res.data.blogList.list[i].otherMap.commentTotal + '</span>\n' ;
                html +=   '                                </li>\n' ;
                if(user_id != "" && user_id == res.data.blogList.list[i].userId){
                    html +=   '                                <li onclick="del(this, ' + res.data.blogList.list[i].id + ');">\n' ;
                    html +=   '                                    <i class="lmlblog-icon"></i>删除 <span></span>\n' ;
                    html +=   '                                </li>\n' ;
                }
                html +=   '                            </div>\n' ;
                html +=   '                            <div class="lmlblog-post-footer-bar" style="background-color: white;margin-top: 0px;">\n' ;
                html +=    '                                <span title="2017-12-14 05:25:48"></span>\n' ;
                html +=   '                                <span></span></div><div id="pllb"></div>' ;
                html +=   '                        </div>';
            }
            $("#list").append(html);

            /*if (res.data.blogList.list.length > 0 && res.data.blogList.totalPage > page) {
                page++;
            } else {
                $(".lmlblog-pager").hide();
            }*/

            //alert(pageNo + " - " + res.data.blogList.list.length+ " - "+res.data.blogList.totalPage);
            if (res.data.blogList.list.length > 0 && res.data.blogList.totalPage > pageNo) {
                pageIndex++;

                $(".lmlblog-pager").show();
            } else {
                $(".lmlblog-pager").hide();
            }

        })
    }

</script>
</body>
</html>




























